package cn.ac.siom.query.dao.impl;

import cn.ac.siom.query.dao.Sys_userDAO;
import cn.ac.siom.query.vo.Sys_user;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;
import java.util.List;
import java.util.Set;

@Repository
public class Sys_userDAOImpl extends SqlSessionDaoSupport implements Sys_userDAO {
    @Autowired
    public Sys_userDAOImpl(SqlSessionFactory sqlSessionFactory2){
        super.setSqlSessionFactory(sqlSessionFactory2);
    }

    @Override
    public boolean doCreate(Sys_user vo) throws SQLException {
        return false;
    }

    @Override
    public boolean doUpdate(Sys_user vo) throws SQLException {
        return false;
    }

    @Override
    public boolean doRemove(Set<?> ids) throws SQLException {
        return false;
    }

    @Override
    public Sys_user findById(Integer id) throws SQLException {
        return null;
    }

    @Override
    public List<Sys_user> findAll() throws SQLException {
        return null;
    }

    @Override
    public List<Sys_user> findAllBySplit(String column, String keyWord, Integer currentPage, Integer lineSize) throws SQLException {
        return null;
    }


    @Override
    public Sys_user getUser(Sys_user user) throws SQLException {

        return super.getSqlSession().selectOne("GetUser.Sys_user",user);

    }

    @Override
    public Sys_user finderoles(String user) throws SQLException {
        return super.getSqlSession().selectOne("GetUser.Sys_user_role",user);
    }

    @Override
    public Sys_user findPermissions(String user) throws SQLException {
        return super.getSqlSession().selectOne("GetUser.Sys_user_role_pers",user);
    }
}
